<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    事项:<input type="text" id="sx" style="margin-bottom: 2px">
    <br>
    时间:<input type="text" id="sj" style="margin-bottom: 2px">
    <br>
    <button style="margin-bottom: 5px" onclick="f()">添加</button>
    <div style="border-bottom: 1px solid black"></div>
    <h2>备忘录</h2>
    <table border="1" cellpadding="0" cellspacing="0" style="border: deepskyblue" id="bg">
        <th style="width: 100px;"></th>
        <th style="width: 200px;">事项</th>
        <th style="width: 200px;">日期</th>
    </table>
    <div style="border-bottom: 1px solid black;margin-top: 4px"></div>
    <h2>已完成</h2>
    <span id="ywc">
    </span>
</body>
</html>
<script>
    var a = 0,b =0;
    function f() {
        var sx = document.getElementById('sx').value;
        var sj = document.getElementById('sj').value;
        a+=1;
        b+=0;
        document.getElementById("bg").innerHTML+= "<tr id="+b+">\n" +
            "            <td style='text-align:center;'><input type='checkbox' id="+a+" onclick='f1(this.id)'></td>\n" +
            "            <td style='text-align:center;'>"+sx+"</td>\n" +
            "            <td style='text-align:center;'>"+sj+"</td>\n" +
            "        </tr>"
    }
    function f1(val) {
        var a = document.getElementById(val).parentNode;
        a = a.parentNode;
        var id = a.id;
        var arr = a.innerText.split("\t");
        var zfc = "";
        for (var i = 1; i < arr.length; i++) {
            zfc += arr[i]+" ";
        }
        document.getElementById('ywc').innerHTML+=zfc+"<br>";
        document.getElementById(id).innerHTML = "";
    }
</script>